
@echo off & setlocal enabledelayedexpansion
set aa=0
for /f "eol=/delims=" %%b in (a.txt) do (
    echo %%b
    set /a "bds[!aa!] = %%b",aa=aa+1
    echo !aa!
) 



SET Obj_Length=2
  
SET Obj[0].Name=Test1
SET Obj[0].Value=Hello World
  
SET Obj[1].Name=Test2
SET Obj[1].Value=blahblah

SET Obj_Index=0
  
:LoopStart
IF %Obj_Index% EQU %Obj_Length% GOTO :EOF
  
SET Obj_Current.Name=0
SET Obj_Current.Value=0
  
FOR /F "usebackq delims==. tokens=1-3" %%I IN (`SET Obj[%Obj_Index%]`) DO (
    SET Obj_Current.%%J=%%K
)
  
ECHO Name = %Obj_Current.Name%
ECHO Value = %Obj_Current.Value%
ECHO.
  
SET /A Obj_Index=%Obj_Index% + 1
  
GOTO LoopStart

goto xx

注释内容

> 参考资料

+ [批处理中setlocalenabledelayedexpansion的作用详细整理](https://www.jb51.net/article/29323.htm)
+ [bat数组实现](https://blog.csdn.net/weixin_34321977/article/details/85576715)
+ [bat中代码注释的几种方法](https://jingyan.baidu.com/article/6fb756ec52ddd1241858fb05.html)
+ [BAT批处理中使用数组示例](https://www.jb51.net/article/67630.htm)

:xx
